/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2022-09-17
 * Time: 21:00
 */
public class Test_MyArrayList {

    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);
        myArrayList.add(4);
        myArrayList.add(5);
        myArrayList.add(6);
        myArrayList.add(7);
        myArrayList.add(8);
        myArrayList.add(9);
        myArrayList.add(10);

/*        try {
            myArrayList.add(1,10);
        }catch (PosIllegalExceptione e){
            e.printStackTrace();
        }
        myArrayList.display();
        System.out.println("==============");
        System.out.println(myArrayList.contains(10));
        System.out.println(myArrayList.contains(100));
        System.out.println("==============");
        System.out.println(myArrayList.indexOf(10));
        System.out.println(myArrayList.indexOf(100));

        System.out.println("=============");
        try {
            System.out.println(myArrayList.get(0));
            System.out.println(myArrayList.get(3));
            //System.out.println(myArrayList.get(5));
        }catch (EmptyException e){
            e.printStackTrace();
        }

        System.out.println("=============");
        myArrayList.set(1,99);
        myArrayList.display();
        System.out.println("=============");
        try {
            myArrayList.remove(99);

        }catch (EmptyException e){
            e.printStackTrace();
        }
        myArrayList.display();
        System.out.println("=============");
        *//*myArrayList.set(1,10);
        myArrayList.display();
        myArrayList.remove(1);*//*
        myArrayList.display();
        myArrayList.remove(3);
        myArrayList.remove(1);*/
        myArrayList.display();
        myArrayList.remove(4);
        myArrayList.display();
    }

}
